/*
 Navicat Premium Dump SQL

 Source Server         : local-mysql-docker
 Source Server Type    : MySQL
 Source Server Version : 80200 (8.2.0)
 Source Host           : localhost:3306
 Source Schema         : book_system

 Target Server Type    : MySQL
 Target Server Version : 80200 (8.2.0)
 File Encoding         : 65001

 Date: 11/06/2025 11:34:09
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for book
-- ----------------------------
DROP TABLE IF EXISTS `book`;
CREATE TABLE `book` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
  `isbn` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '图书编号',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '名称',
  `price` decimal(10,2) DEFAULT NULL COMMENT '价格',
  `author` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '作者',
  `publisher` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '出版社',
  `create_time` date DEFAULT NULL COMMENT '出版时间',
  `status` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '0：未归还 1：已归还',
  `borrownum` int NOT NULL COMMENT '此书被借阅次数',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of book
-- ----------------------------
BEGIN;
INSERT INTO `book` (`id`, `isbn`, `name`, `price`, `author`, `publisher`, `create_time`, `status`, `borrownum`) VALUES (9, '12341541321', '十万个为什么', 15.00, '小王', '宁波大学出版社', '2014-12-16', '1', 8);
INSERT INTO `book` (`id`, `isbn`, `name`, `price`, `author`, `publisher`, `create_time`, `status`, `borrownum`) VALUES (10, '2312315132131', '五万个为什么', 50.00, '123', '456', '2025-06-09', '1', 3);
INSERT INTO `book` (`id`, `isbn`, `name`, `price`, `author`, `publisher`, `create_time`, `status`, `borrownum`) VALUES (11, '25213121232', '一万个为什么', 50.00, '123', '456', '2025-06-09', '1', 5);
INSERT INTO `book` (`id`, `isbn`, `name`, `price`, `author`, `publisher`, `create_time`, `status`, `borrownum`) VALUES (12, '3213123123', '操作系统', NULL, NULL, NULL, NULL, '0', 8);
INSERT INTO `book` (`id`, `isbn`, `name`, `price`, `author`, `publisher`, `create_time`, `status`, `borrownum`) VALUES (13, '345621212321', '伊索寓言', NULL, NULL, NULL, NULL, '0', 9);
INSERT INTO `book` (`id`, `isbn`, `name`, `price`, `author`, `publisher`, `create_time`, `status`, `borrownum`) VALUES (15, '54112312321', '格林童话', NULL, NULL, NULL, NULL, '1', 1);
INSERT INTO `book` (`id`, `isbn`, `name`, `price`, `author`, `publisher`, `create_time`, `status`, `borrownum`) VALUES (16, '666', '三国演义', 50.00, '罗贯中', NULL, '2025-06-12', '0', 1);
COMMIT;

-- ----------------------------
-- Table structure for bookwithuser
-- ----------------------------
DROP TABLE IF EXISTS `bookwithuser`;
CREATE TABLE `bookwithuser` (
  `id` bigint NOT NULL COMMENT '读者id',
  `isbn` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '图书编号',
  `book_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '图书名',
  `nick_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '读者姓名',
  `lendtime` datetime DEFAULT NULL COMMENT '借阅时间',
  `deadtime` datetime DEFAULT NULL COMMENT '应归还时间',
  `prolong` int DEFAULT NULL COMMENT '续借次数',
  PRIMARY KEY (`book_name`) USING BTREE,
  KEY `id` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of bookwithuser
-- ----------------------------
BEGIN;
INSERT INTO `bookwithuser` (`id`, `isbn`, `book_name`, `nick_name`, `lendtime`, `deadtime`, `prolong`) VALUES (18, '666', '三国演义', 'test', '2025-06-11 11:22:07', '2025-08-10 11:22:07', 0);
INSERT INTO `bookwithuser` (`id`, `isbn`, `book_name`, `nick_name`, `lendtime`, `deadtime`, `prolong`) VALUES (14, '345621212321', '伊索寓言', '123456', '2025-06-10 17:30:48', '2025-06-10 17:30:48', 0);
INSERT INTO `bookwithuser` (`id`, `isbn`, `book_name`, `nick_name`, `lendtime`, `deadtime`, `prolong`) VALUES (14, '3213123123', '操作系统', '123456', '2025-06-10 17:30:42', '2025-06-10 17:30:42', 1);
COMMIT;

-- ----------------------------
-- Table structure for lend_record
-- ----------------------------
DROP TABLE IF EXISTS `lend_record`;
CREATE TABLE `lend_record` (
  `reader_id` bigint NOT NULL COMMENT '读者id',
  `isbn` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '图书编号',
  `bookname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '图书名',
  `lend_time` datetime DEFAULT NULL COMMENT '借书日期',
  `return_time` datetime DEFAULT NULL COMMENT '还书日期',
  `status` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '0：未归还 1：已归还',
  `borrownum` int NOT NULL COMMENT '此书被借阅次数'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of lend_record
-- ----------------------------
BEGIN;
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '92392321222', '算法笔记', '2025-06-10 10:57:02', '2025-06-10 11:03:54', '1', 2);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '465132123123', '狂人日记', '2025-06-10 10:59:21', '2025-06-10 11:22:51', '1', 2);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '54156461231', '十万个为什么', '2025-06-10 10:59:21', '2025-06-10 11:04:38', '1', 4);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '54156461231', '十万个为什么', '2025-06-10 11:04:40', '2025-06-10 11:05:22', '1', 5);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '92392321222', '算法笔记', '2025-06-10 11:04:51', '2025-06-10 11:05:24', '1', 3);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '54156461231', '十万个为什么', '2025-06-10 11:05:27', '2025-06-10 11:10:19', '1', 6);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '92392321222', '算法笔记', '2025-06-10 11:05:29', '2025-06-10 11:06:09', '1', 4);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '92392321222', '算法笔记', '2025-06-10 11:06:11', '2025-06-10 11:06:38', '1', 5);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '92392321222', '算法笔记', '2025-06-10 11:06:42', '2025-06-10 11:06:52', '1', 6);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '92392321222', '算法笔记', '2025-06-10 11:06:53', '2025-06-10 11:10:20', '1', 7);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '92392321222', '算法笔记', '2025-06-10 11:06:54', '2025-06-10 11:10:20', '1', 7);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '92392321222', '算法笔记', '2025-06-10 11:06:54', '2025-06-10 11:10:20', '1', 7);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '92392321222', '算法笔记', '2025-06-10 11:06:55', '2025-06-10 11:10:20', '1', 7);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '92392321222', '算法笔记', '2025-06-10 11:06:55', '2025-06-10 11:10:20', '1', 7);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '92392321222', '算法笔记', '2025-06-10 11:06:55', '2025-06-10 11:10:20', '1', 7);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '92392321222', '算法笔记', '2025-06-10 11:06:55', '2025-06-10 11:10:20', '1', 7);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '92392321222', '算法笔记', '2025-06-10 11:06:55', '2025-06-10 11:10:20', '1', 7);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '92392321222', '算法笔记', '2025-06-10 11:06:55', '2025-06-10 11:10:20', '1', 7);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '92392321222', '算法笔记', '2025-06-10 11:06:56', '2025-06-10 11:10:20', '1', 7);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '92392321222', '算法笔记', '2025-06-10 11:06:56', '2025-06-10 11:10:20', '1', 7);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '92392321222', '算法笔记', '2025-06-10 11:06:56', '2025-06-10 11:10:20', '1', 7);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (13, '92392321222', '算法笔记', '2025-06-10 11:06:56', '2025-06-10 11:10:20', '1', 7);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '12341541321', '十万个为什么', '2025-06-10 16:27:35', '2025-06-10 20:18:58', '1', 1);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '2312315132131', '五万个为什么', '2025-06-10 16:27:36', '2025-06-10 20:18:59', '1', 1);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '25213121232', '一万个为什么', '2025-06-10 16:27:38', '2025-06-10 16:29:22', '1', 1);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '3213123123', '操作系统', '2025-06-10 16:27:40', '2025-06-10 16:29:15', '1', 1);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '3213123123', '操作系统', '2025-06-10 16:29:24', '2025-06-10 20:19:01', '1', 2);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '25213121232', '一万个为什么', '2025-06-10 11:37:54', '2025-06-10 20:19:00', '1', 2);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '345621212321', '伊索寓言', '2025-06-10 11:37:58', '2025-06-10 11:38:42', '1', 1);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (15, '345621212321', '伊索寓言', '2025-06-10 13:13:10', '2025-06-10 13:13:26', '1', 2);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '12341541321', '十万个为什么', '2025-06-10 20:19:09', '2025-06-10 15:45:35', '1', 2);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '25213121232', '一万个为什么', '2025-06-10 20:19:11', '2025-06-10 15:45:32', '1', 3);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '2312315132131', '五万个为什么', '2025-06-10 20:20:00', '2025-06-10 15:45:34', '1', 2);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '3213123123', '操作系统', '2025-06-10 20:20:01', '2025-06-10 15:45:27', '1', 3);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '345621212321', '伊索寓言', '2025-06-10 20:20:02', '2025-06-10 20:20:11', '1', 3);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '3213123123', '操作系统', '2025-06-10 15:45:37', '2025-06-10 15:45:39', '1', 4);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '3213123123', '操作系统', '2025-06-10 15:46:15', '2025-06-10 15:51:05', '1', 5);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '3213123123', '操作系统', '2025-06-10 15:51:12', '2025-06-10 15:51:15', '1', 6);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '3213123123', '操作系统', '2025-06-10 15:51:16', '2025-06-10 16:48:09', '1', 7);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '25213121232', '一万个为什么', '2025-06-10 16:48:10', '2025-06-10 16:48:13', '1', 4);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '345621212321', '伊索寓言', '2025-06-10 16:48:19', '2025-06-10 17:30:46', '1', 4);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '3213123123', '操作系统', '2025-06-10 17:30:42', NULL, '0', 8);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (14, '345621212321', '伊索寓言', '2025-06-10 17:30:48', NULL, '0', 9);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (16, '12341541321', '十万个为什么', '2025-06-10 14:55:34', '2025-06-10 16:36:54', '1', 3);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (16, '2312315132131', '五万个为什么', '2025-06-10 14:59:03', '2025-06-10 16:36:55', '1', 3);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (16, '25213121232', '一万个为什么', '2025-06-10 14:59:05', '2025-06-10 16:36:56', '1', 5);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (17, '54112312321', '格林童话', '2025-06-10 20:02:01', '2025-06-10 20:02:51', '1', 1);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (16, '12341541321', '十万个为什么', '2025-06-10 16:37:01', '2025-06-10 16:37:28', '1', 4);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (16, '12341541321', '十万个为什么', '2025-06-10 16:37:32', '2025-06-10 16:43:30', '1', 5);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (16, '12341541321', '十万个为什么', '2025-06-10 16:43:39', '2025-06-10 16:43:43', '1', 6);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (16, '12341541321', '十万个为什么', '2025-06-10 16:44:14', '2025-06-10 16:44:18', '1', 7);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (18, '666', '三国演义', '2025-06-11 11:22:07', NULL, '0', 1);
INSERT INTO `lend_record` (`reader_id`, `isbn`, `bookname`, `lend_time`, `return_time`, `status`, `borrownum`) VALUES (18, '12341541321', '十万个为什么', '2025-06-11 11:33:10', '2025-06-11 11:33:14', '1', 8);
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
  `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '用户名',
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '密码',
  `nick_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '姓名',
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '电话号码',
  `sex` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '性别',
  `address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '地址',
  `role` int NOT NULL COMMENT '角色、1：管理员 2：普通用户',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='用户信息表';

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` (`id`, `username`, `password`, `nick_name`, `phone`, `sex`, `address`, `role`) VALUES (17, 'leilei', '123456', NULL, NULL, NULL, NULL, 1);
INSERT INTO `user` (`id`, `username`, `password`, `nick_name`, `phone`, `sex`, `address`, `role`) VALUES (18, 'test', '123456', '测试用户', '15787678787', '男', '124', 2);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
